<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>Attribute Details</title>
</head>
<body>
	<h1>Attribute Details</h1>
	<form:form id="attributeForm" action="attribute-form.html" commandName="attribute">
		<form:hidden path="id"/>
		<form:hidden path="parentClassId"/>
		<table>
			<tr>
				<th>Name</th>
				<td><form:input path="attributeName"/></td>
				<td>Use Camel Case, No Space and Special Characters Allowed</td>
			</tr>
			<tr>
				<th>Description</th>
				<td><form:textarea path="attributeDesc"/></td>
				<td></td>
			</tr>
			<tr>
				<th>Java Data Type</th>
				<td>
					<form:select path="javaDataType">
						<form:option value="String">String</form:option>
						<form:option value="Integer">Integer</form:option>
						<form:option value="Float">Float</form:option>
						<form:option value="Boolean">Boolean</form:option>
						<form:option value="Date">Date</form:option>
						<form:option value="Long">Long</form:option>
						<form:option value="Double">Double</form:option>
					</form:select>
				</td>
				<td></td>
			</tr>
			<tr>
				<th>Column Name</th>
				<td><form:input path="columnName"/></td>
				<td></td>
			</tr>
			<tr>
				<th>SQL Data Type</th>
				<td>
					<form:select path="sqlDataType">
						<form:option value="varchar">varchar</form:option>
						<form:option value="varchar2">varchar2</form:option>
						<form:option value="char">char</form:option>
						<form:option value="int">int</form:option>
						<form:option value="date">date</form:option>
						<form:option value="datetime">datetime</form:option>
					</form:select>
				</td>
				<td></td>
			</tr>			
			<tr>
				<th>Max Length</th>
				<td><form:input path="maxLength"/></td>
				<td></td>
			</tr>
			<tr>
				<th>Is Mandatory</th>
				<td>
					<form:radiobutton path="isMandatory" value="true"/> Yes<br/>
					<form:radiobutton path="isMandatory" value="false"/> No
				</td>
				<td></td>
			</tr>
			<tr>
				<th>Index In Attribute List</th>
				<td><form:input path="indexInAttributeList"/></td>
				<td></td>
			</tr>
		</table>
		<input type="button" value="Cancel" onclick="javascript:location.href='attribute-list.html?method=list&parentClassId=<c:out value="${attribute.parentClassId}"/>'"/>
		<input type="submit" value="Save"/>
	</form:form>
</body>
</html>